package com.aaa.service.impl;

import com.aaa.dao.CountyDao;
import com.aaa.entity.County;
import com.aaa.service.CountyService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CountyServiceImpl implements CountyService {

    @Autowired
    CountyDao cd;
    @Override
    public List<County> findCounty(County county) {
        return cd.findCounty(county);
    }

    @Override
    public Map findCountyById(int couId) {
        return cd.findCountyById(couId);
    }

    @Override
    public int updateCounty(County county) {
        return cd.updateCounty(county);
    }

    @Override
    public List<Map> findCountyDesc() {
        return cd.findCountyDesc();
    }

    @Override
    public int countyAdd(County county) {
        return cd.countyAdd(county);
    }

    @Override
    public int countyDel(int couId) {
        return cd.countyDel(couId);
    }

    @Override
    public PageInfo findCountyByCity(String provName,String city,String county,int page,int size) {
        PageHelper.startPage(page,size);
        List<Map> list= cd.findCountyByCity(provName,city, county);
        return new PageInfo(list);

    }
}
